package com.example.mymnue;

import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Build;
import android.os.Environment;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class ShopDB extends SQLiteOpenHelper {
    private static final int VERSION = 1;
    private static final String DB_NAME = "mymenu.db";
    public static final String TB_NAME = "tb_menu";
    public ShopDB( Context context,  String name,  SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    public ShopDB(Context context){
        super(context,
                DB_NAME,
                null,
                VERSION);


    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE "+TB_NAME+"(ID INTEGER PRIMARY KEY AUTOINCREMENT, " +
                "DATA TEXT," +
                "TIME TEXT," +
                "TITLE TEXT," +
                "DETAIL TEXT )");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}